{%include file="m.index.header.tpl.php"%}
<!--主体部分-->
<div class="container" style="margin-top:70px;"> 
  
  <!-- <div class="row" style="margin-right:10%;">
    <div  class="col-xs-sm  text-right" > <a class="btn btn-primary" href="superior_notice_add.html" style="width:30%">增加</a></div>
  </div>
   -->
<form name="myform" action="" method="get">
  <div class="row" style="margin-top:10px;">
    <div class="col-sm-12 distance" >
	<div class="form-group">
        <label for="inputEmail3" class="col-sm-2 control-label">年级:</label>
        <div class="col-sm-10">
          <select class="form-control" name="grade_id" id="grade_id">
			<option value=""> 全部</option>
			{%foreach from=$grade_lists key=key item=value%}
			<option value="{%$value.grade_id%}"{%if $value.grade_id==$grade_id%}selected{%/if%}>{%$value.grade_name%}</option>
			{%/foreach%}
		  </select> 
        </div>
      </div>
	  <div class="form-group">
        <label for="inputEmail3" class="col-sm-2 control-label">班级：</label>
        <div class="col-sm-10">
          <select class="form-control" name="class_id" id="class_id">
			<option value=""> 全部</option>
			{%foreach from=$class_lists key=key item=value%}
			<option value="{%$value.class_id%}"{%if $value.class_id ==$class_id%}selected{%/if%}>{%$value.class_name%}</option>
			{%/foreach%}
		  </select> 
        </div>
      </div>
      <div class="form-group">
        <label for="" class="col-sm-2 control-label">姓名：</label>
        <div class="col-sm-10">
          <input type="text" class="form-control" name="student_name" value="{%$student_name%}">
        </div>
      </div>
	  <div class="form-group">
        <label for="" class="col-sm-2 control-label">学号：</label>
        <div class="col-sm-10">
          <input type="text" class="form-control" value="{%$student_no%}" name="student_no">
        </div>
      </div>
    </div>
    <div class="col-xs-12 distance hierarchy2">
      <div class="form-group  text-center" style="padding-top:0px;">
		<input type="hidden" name="a" value="classstudent.classstudentlist">
        <button type="submit" class="btn btn-success absolutely ">搜索</button>
      </div>
    </div>
  </div>
  <div class="row" style="margin-top:15px;margin-left:1px; margin-right:1px;" >
  {%foreach from=$classstudent_lists key=key item=value%}
    <table class="table table-striped table-bordered text-center"  id="middles" >
      <tr>
        <td>姓名</td>
        <td>{%$value.student_name%}</td>
      </tr>
      <tr>
        <td>性别</td>
        <td>{%if $value.student_sex eq 1%}男{%else%}女{%/if%}</td>
      </tr>
	  <tr>
        <td>学号</td>
        <td>{%$value.student_no%}</td>
      </tr>
	  <tr>
        <td>学籍号</td>
        <td>{%$value.student_school%}</td>
      </tr>
	  <tr>
        <td>出生日期</td>
        <td>{%$value.student_birth%}</td>
      </tr>
	  <tr>
        <td>家庭地址</td>
        <td>{%$value.student_addr%}</td>
      </tr>
	  <tr>
        <td>联系电话</td>
        <td>{%$value.student_tel%}</td>
      </tr>
    </table>
 {%/foreach%}
  </div>
</div>
<!--container  end--> 
<!--主体部分  end--> 
<!--底部-->
{%include file="m.index.footer.tpl.php"%} 
<script type="text/javascript">
        $(document).ready(function () {
            $("#grade_id").change(function () {		
                if ($(this).val() == "-1") {
					$("#industr").remove(); return; 
					}
                else {
			var timestamp = new Date().getTime();
			$.ajax({
			url:"index.php?a=student.gradelistjson",
			type:"get",
			data: "grade_id=" + $("#grade_id").find("option:selected").val() + "&timestamp=" + timestamp,
			dataType:"json",
			success:function(msg){
			   
                            //实例2个字符串变量来拼接下拉列表
                            var industr = "";
                            //使用jquery解析json中的数据
                            $.each(msg, function (n, value) {
                                industr += ("<option value=\"" + value.class_id + "\">" + value.class_name);
                                industr += ("</option>");
                            });

                            $("#class_id").html(industr);			   			   
			}
			});					

                }

            });

        });
</script>